<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>快速登录 - 纯美图</title>
<link href="{LAYUI_PATH}css/layui.css" rel="stylesheet" type="text/css" />
<link href="{LAYUI_PATH}css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{LAYUI_PATH}layui.js"></script>
</head>
<body style="background-color: #FFF;">
<div class="layui-fastlogin">
	<form method="post" action="" class="layui-form layui-form-pane">
    	<div class="layui-form-item">
			<label class="layui-form-label">用户</label>
			<div class="layui-input-block">
				<input type="text" id="username" name="username" lay-verify="required" autocomplete="off" placeholder="请输入用户名" class="layui-input" style="width: 170px;">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">密码</label>
			<div class="layui-input-block">
				<input type="password" id="password" name="password" lay-verify="required" autocomplete="off" placeholder="请输入密码" class="layui-input" style="width: 170px;">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">验证码</label>
			<div class="layui-input-block">
				<input type="text" id="code" name="code" autocomplete="off" lay-verify="required" placeholder="验证码" class="layui-input" style="width: 74px;">{form::checkcode('code_img', '4', '12', 60, 26)}
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-inline" style="width:100%;">
				<input type="submit" name="dosubmit" id="dosubmit" class="layui-btn" lay-submit="" lay-filter="dosubmit" value="{L('login')}">
			</div>
		</div>
	</form>
</div>
<script>
layui.use(['form','jquery','layer'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,$ = layui.jquery;
  form.on('submit(dosubmit)', function(data){
  	//console.log(data);
  	$.post('/index.php?m=member&c=index&a=check_fastlogin', {username:data.field.username, password:data.field.password, code:data.field.code}, function(str){
  		if(str == 1){
  			parent.location.reload();
  		}
  		if(str == 2){
  			layer.msg('账户或密码错误！',{icon: 2, time: 500});
  		}
  		if(str == 3){
  			layer.msg('验证码错误！',{icon: 2, time: 500});
  		}
   		if(str == 4){
  			layer.msg('此账户已锁定！',{icon: 2, time: 500});
  		} 		
  	});
  	return false;
  })
});
</script>
</body>
</html>